package com.ny.shiyan.shiyan3;

import java.util.Scanner;

public class EmployeeSystem {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("职工信息录入系统");
        System.out.print("请输入职工编号: ");
        String employeeId = scanner.nextLine();

        System.out.print("请输入姓名: ");
        String name = scanner.nextLine();

        System.out.print("请输入所在部门: ");
        String department = scanner.nextLine();

        System.out.print("请输入年龄: ");
        int age = scanner.nextInt();
        scanner.nextLine();

        System.out.print("请输入性别(男/女): ");
        String gender = scanner.nextLine();

        System.out.print("请输入联系方式: ");
        String contact = scanner.nextLine();

        Employee employee1 = new Employee();
        employee1.setEmployeeId(employeeId);
        employee1.setName(name);
        employee1.setDepartment(department);
        employee1.setAge(age);
        employee1.setGender(gender);
        employee1.setContact(contact);

        System.out.println("使用无参构造函数创建的对象");
        employee1.displayInfo();

        Employee employee2 = new Employee(employeeId, name, department, age, gender, contact);

        System.out.println("使用有参构造函数创建的对象");
        employee2.displayInfo();

        scanner.close();
    }
}
